#include "TimeZone.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* TimeZone_classType = NULL;
VTable* TimeZone_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* Str toStr() */
Str* TimeZone_toStr(Obj self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.toStr not implemented yet"));
}


/* Str[] listNames() */
List* TimeZone_listNames(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.listNames not implemented yet"));
}


/* Str[] listFullNames() */
List* TimeZone_listFullNames(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.listFullNames not implemented yet"));
}


/* TimeZone? fromStr(Str name, Bool checked) */
TimeZone* TimeZone_fromStr_1(Str* name)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.fromStr not implemented yet"));
}


/* TimeZone? fromStr(Str name, Bool checked) */
TimeZone* TimeZone_fromStr(Str* name, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.fromStr not implemented yet"));
}


/* TimeZone utc() */
TimeZone* TimeZone_utc(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.utc not implemented yet"));
}


/* TimeZone rel() */
TimeZone* TimeZone_rel(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.rel not implemented yet"));
}


/* TimeZone cur() */
TimeZone* TimeZone_cur(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.cur not implemented yet"));
}


/* TimeZone defVal() */
TimeZone* TimeZone_defVal(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.defVal not implemented yet"));
}


/* Str name() */
Str* TimeZone_name(TimeZone* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.name not implemented yet"));
}


/* Str fullName() */
Str* TimeZone_fullName(TimeZone* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.fullName not implemented yet"));
}


/* Duration offset(Int year) */
Duration* TimeZone_offset(TimeZone* self, Int year)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.offset not implemented yet"));
}


/* Duration? dstOffset(Int year) */
Duration* TimeZone_dstOffset(TimeZone* self, Int year)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.dstOffset not implemented yet"));
}


/* Str stdAbbr(Int year) */
Str* TimeZone_stdAbbr(TimeZone* self, Int year)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.stdAbbr not implemented yet"));
}


/* Str? dstAbbr(Int year) */
Str* TimeZone_dstAbbr(TimeZone* self, Int year)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::TimeZone.dstAbbr not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* TimeZone_initType(void)
{
  if (TimeZone_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = TimeZone_initVTable();
    Type* type = Type_new("TimeZone", baseType, vtable, sizeof(TimeZone), sizeof(TimeZoneVTable));
    Type_registerMethodImplementation(type, "cur", TimeZone_cur, 0);
    Type_registerMethodImplementation(type, "defVal", TimeZone_defVal, 0);
    Type_registerMethodImplementation(type, "dstAbbr", TimeZone_dstAbbr, 1);
    Type_registerMethodImplementation(type, "dstOffset", TimeZone_dstOffset, 1);
    Type_registerMethodImplementation(type, "fromStr", TimeZone_fromStr_1, 1);
    Type_registerMethodImplementation(type, "fromStr", TimeZone_fromStr, 2);
    Type_registerMethodImplementation(type, "fullName", TimeZone_fullName, 0);
    Type_registerMethodImplementation(type, "listFullNames", TimeZone_listFullNames, 0);
    Type_registerMethodImplementation(type, "listNames", TimeZone_listNames, 0);
    Type_registerMethodImplementation(type, "name", TimeZone_name, 0);
    Type_registerMethodImplementation(type, "offset", TimeZone_offset, 1);
    Type_registerMethodImplementation(type, "rel", TimeZone_rel, 0);
    Type_registerMethodImplementation(type, "stdAbbr", TimeZone_stdAbbr, 1);
    Type_registerMethodImplementation(type, "toStr", TimeZone_toStr, 0);
    Type_registerMethodImplementation(type, "utc", TimeZone_utc, 0);
    TimeZone_classType = type;
    TimeZone_initStatic();
  }
  return TimeZone_classType;
}


VTable* TimeZone_initVTable(void)
{
  if (TimeZone_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(TimeZoneVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    ((FanObjVTable*)vtable)->toStr = TimeZone_toStr;
    TimeZone_classVTable = vtable;
  }
  return TimeZone_classVTable;
}


void TimeZone_initStatic(void)
{
}
